package com.ailk.cuc.autotestbg.startup;

import org.apache.commons.logging.Log;

import com.ailk.cuc.autotestbg.common.exception.DataBaseException;
import com.ailk.cuc.autotestbg.common.utils.InitUtils;
import com.ailk.cuc.autotestbg.common.utils.LogUtils;
import com.ailk.cuc.autotestbg.xml.constants.EssEcsConstants;

public class ServerBootstrap {

	private static Log logger = LogUtils.getLogger(ServerBootstrap.class.getName());
	
	public void init(){
		try {
			logger.info("初始化系统参数");
			InitUtils.initStaticParam(EssEcsConstants.XML_CONFIG_NAME);
			logger.info("系统参数初始化完毕");
			
			logger.info("开始启动SERVER");
			startServer();
			logger.info("SERVER启动完毕");
		} catch (DataBaseException e) {
			logger.info("系统启动失败，请检查系统配置。。。");
			logger.info(e.getMessage());
		}
	}
	
	private void startServer(){
		ServerSocketThread serversocket = new ServerSocketThread();
		serversocket.start();
	}
}
